package com.itheima.a01test4;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        /*
        客户端：实现数据多次的发送
        服务器：实现数据多次的接收
         */
        ServerSocket ss = new ServerSocket(10000);

        //进行客户端的链接
        Socket socket = ss.accept();

        //进行数据的读取
        //InputStream is = socket.getInputStream();
        InputStreamReader isr = new InputStreamReader(socket.getInputStream());
        int b;
        while ((b = isr.read()) != -1) {
            System.out.print((char) b);
        }

        //进行关流
        ss.close();
    }
}
